package mfuny.ggongal.admin;

import mfuny.ggongal.admin.terms.TermsDao;
import mfuny.ggongal.admin.terms.TermsService;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class TermsController {
	TermsService ts;
	
	public TermsController() throws Exception {
		ts = new TermsService();
	}
	
	@RequestMapping("/termsList.ga")
	public ModelAndView termsList() throws Exception {
		return ts.termsList( );
	}
	
	@RequestMapping("/termsList_result.ga")
	public ModelAndView termsList_result( int terms_type ) throws Exception {
		return ts.termsList_result( terms_type );
	}
	
	@RequestMapping("/regTermsForm.ga")
	public ModelAndView regTermsForm() throws Exception {
		return ts.regTermsForm( );
	}
	
	@RequestMapping("/regTerms.ga")
	public ModelAndView regTerms(@ModelAttribute TermsDao termsClass ) throws Exception {
		return ts.regTerms( termsClass );
	}
	
	@RequestMapping("/readTerms.ga")
	public ModelAndView readTerms(int terms_no) throws Exception {
		return ts.readTerms( terms_no );
	}
	
	@RequestMapping("/deleteTerms.ga")
	public ModelAndView deleteTerms( int terms_no ) throws Exception {
		return ts.deleteTerms( terms_no );
	}
	
	@RequestMapping("/modifyTermsForm.ga")
	public ModelAndView modifyTermsForm( int terms_no ) throws Exception {
		return ts.modifyTermsForm(terms_no);
	}
	
	@RequestMapping("/modifyTerms.ga")
	public ModelAndView modifyTerms( @ModelAttribute TermsDao termsClass ) throws Exception {
		return ts.modifyTerms(termsClass);
	}
}
